<?php
/**
 * Create By: PhpStorm
 * User: yihua
 * File: Error.php
 * Date: 2016/12/10
 * Time: 19:45
 */
namespace app\library;

class Error
{
    const ERR_SUCCESS = 0;

    //系统错误以 1 开始
    const ERR_SYS = -1000;
    const ERR_PARAM = -1001;
    const ERR_VERIFY_CODE = -1002;
    const ERR_PASSWORD = -1003;
    const ERR_REGISTERED = -1004;
    const ERR_USER_NOT_EXIST = -1005;
    const ERR_PHONE_FORMAT = -1006;
    const ERR_NOT_REGISTERED = -1007;
    const ERR_DATA_EXIST = -1008;
    const ERR_CUSTOM = -1009;

    //业务错误 以 2 开始
    const ERR_USER_ADDRESS_DUPLICATED = -2001;
    const ERR_USER_ADDRESS_REMOVE = -2002;
    const ERR_USER_ADDRESS_MAX = -2003;
    const ERR_USER_ADDRESS_UPDATE = -2004;
    const ERR_USER_FEEDBACK_ADD = -2005;
    const ERR_SEND_SMS = -2006;
    const ERR_NO_AUTH = -2007;
    const ERR_CIRCLE_APPROVE_NOT = -2008;
    const ERR_CIRCLE_DELETED = -2009;
    const ERR_COUPON_NOT_EXISTS = -2010;
    const ERR_COUPON_OUT_OF_RANGE = -2011;
    const ERR_COUPON_RECEIVED = -2012;
    const ERR_CIRCLE_APPROVE_PASS = -2013;
    const ERR_CIRCLE_NOT_EXIST = -2014;
    const ERR_NOTE_NOT_EXIST = -2015;
    const ERR_NOTE_DELETED = -2016;
    const ERR_DASHANG_GIFT_NOT_EXIST = -2017;
    const ERR_DASHANG_GIFT_DOWN = -2018;
    const ERR_DASHANG_GIFT_EMPTY = -2019;
    const ERR_USER_FOLLOW_CIRCLE = -2020;
    const ERR_USER_CURRENCY_NOT_ENOUGH = -2021;
    const ERR_NOTE_APPROVE = -2022;
    const ERR_SIGNIN_EXIST = -2023;

    //收藏
    const ERROR_ADD_FAVORITE_NOT_EXIST = -2024;
    const ERROR_REMOVE_FAVORITE_NOT_EXIST = -2025;
    const ERROR_ADD_FAVORITE_ALREADY_EXIST = -2026;
    const ERR_GOODSCATEGORY_HAS_GOODS = -2027;
    const ERR_GOODSCATEGORY_HAS_SUBCATEGORY = -2028;

    const ERR_BANNER_IS_DEFAULT = -2029;//广告


    const ERR_CIRCLE_APPROVE_REJECT = -2030;
    const ERR_NOTE_PRAISE_EXIST = -2031;
    const ERR_NOTE_REWARD_NOT_MINE = -2032;
    const ERR_USER_IS_SILENCE = -2033;
    const ERR_HAS_FORBIDDEN_WORD = -2034;

    // 上传文件报错 以 3 开始
    const ERR_FILE_LARGER_THAN_SERVER = -3001;
    const ERR_FILE_LARGER = -3002;
    const ERR_FILE_UNCOMPLETE = -3003;
    const ERR_FILE_LOAD = -3004;
    const ERR_FILE_CONTENT_ERROR = -3005;
    const ERR_FILE_TYPE_ERROR = -3006;
    const ERR_FILE_TYPE_MD5ERROR = -3007;
    const ERR_FILE_TOO_LARGE = -3008;
    const ERR_FILE_UPLOAD_FAIL = -3009;

    // 商城相关 以 4 开始
    const ERROR_CART_GOODS_NUMBER_ERROR = -4001;
    const ERROR_GOODS_NOT_EXIST = -4002;

    static $arr_err_msg = array(
        self::ERR_SUCCESS => 'success',
        self::ERR_PARAM => '参数错误',
        self::ERR_SYS => '系统错误',
        self::ERR_CUSTOM => '自定义错误',
        self::ERR_NO_AUTH => '用户未登录',
        self::ERR_VERIFY_CODE => '验证码错误',
        self::ERR_SEND_SMS => '验证码发送失败',
        self::ERR_PASSWORD => '用户密码错误',
        self::ERR_REGISTERED => '用户已经注册',
        self::ERR_NOT_REGISTERED => '用户未注册',
        self::ERR_DATA_EXIST => '数据已存在',
        self::ERR_USER_NOT_EXIST => '用户不存在',
        self::ERR_PHONE_FORMAT => '手机号码错误',
        self::ERR_USER_ADDRESS_DUPLICATED => '收货地址重复',
        self::ERR_USER_ADDRESS_REMOVE => '此地址不存在或者已经删除',
        self::ERR_USER_ADDRESS_UPDATE => '更新地址失败',
        self::ERR_USER_ADDRESS_MAX => '每个用户最多可以添加5个收货地址',
        self::ERR_USER_FEEDBACK_ADD => '添加用户反馈失败',
        self::ERR_CIRCLE_APPROVE_NOT => '圈子尚未审核通过',
        self::ERR_CIRCLE_APPROVE_PASS => '圈子已经审核通过，请刷新页面~',
        self::ERR_CIRCLE_APPROVE_REJECT => '圈子已被驳回，请刷新页面~',
        self::ERR_CIRCLE_DELETED => '圈子已被删除',
        self::ERR_CIRCLE_NOT_EXIST => '圈子不存在',
        self::ERR_COUPON_NOT_EXISTS => '优惠券不存在',
        self::ERR_COUPON_OUT_OF_RANGE => '优惠券已经领完了',
        self::ERR_COUPON_RECEIVED => '已经领过此类优惠券',
        self::ERR_NOTE_NOT_EXIST => '帖子不存在',
        self::ERR_NOTE_DELETED => '帖子已被删除',
        self::ERR_NOTE_APPROVE => '帖子已经审核过了~',
        self::ERR_DASHANG_GIFT_NOT_EXIST => '打赏的礼物不存在',
        self::ERR_DASHANG_GIFT_DOWN => '打赏的礼物已下架',
        self::ERR_DASHANG_GIFT_EMPTY => '暂时没有打赏礼物',
        self::ERR_USER_FOLLOW_CIRCLE => '您已经关注过啦~',

        self::ERR_FILE_LARGER_THAN_SERVER => '文件大小超过服务器限制',
        self::ERR_FILE_LARGER => '文件太大！',
        self::ERR_FILE_UNCOMPLETE => '文件加载不全',
        self::ERR_FILE_LOAD => '文件加载失败',
        self::ERR_FILE_CONTENT_ERROR => '文件内容错误',
        self::ERR_FILE_TYPE_ERROR => '文件格式错误',
        self::ERR_FILE_TYPE_MD5ERROR => '文件上传内容不符',
        self::ERR_FILE_TOO_LARGE => '上传文件大小超过限制',
        self::ERR_FILE_UPLOAD_FAIL => '上传文件失败',
        self::ERR_SIGNIN_EXIST => '您已经签过到啦~',
        self::ERROR_ADD_FAVORITE_NOT_EXIST => '收藏不存在~',
        self::ERROR_REMOVE_FAVORITE_NOT_EXIST => '此收藏已经被删除或者此用户没有该收藏~',
        self::ERROR_ADD_FAVORITE_ALREADY_EXIST => '此收藏已经被收藏过',

        self::ERR_USER_CURRENCY_NOT_ENOUGH => '您的资金不足',
        self::ERR_GOODSCATEGORY_HAS_GOODS => '该分类下存在商品，无法删除',
        self::ERR_GOODSCATEGORY_HAS_SUBCATEGORY => '该分类下存在子分类，请先删除子分类',

        self::ERROR_CART_GOODS_NUMBER_ERROR => '商品库存不足',
        self::ERR_BANNER_IS_DEFAULT => '默认广告不能删除或者关闭',
        self::ERR_NOTE_PRAISE_EXIST => '您已经点过赞啦~',
        self::ERR_NOTE_REWARD_NOT_MINE => '您不能自己给自己打赏~',
        self::ERR_USER_IS_SILENCE => '您当前被禁言中~',
        self::ERR_HAS_FORBIDDEN_WORD => '您输入的内容中含有敏感词汇',
        self::ERROR_GOODS_NOT_EXIST => '商品不存在',
    );
}
